<?php if($user->access!=0){ ?>
<?php 
if (isset($_POST['old_passwd']) and isset($_POST['new_passwd1']) and isset($_POST['new_passwd2'])){
	if(($_POST['new_passwd1'] != "") and ($_POST['new_passwd1'] == $_POST['new_passwd2']) ){
		if ($user->set_new_password($_POST['old_passwd'],$_POST['new_passwd1'])){
			$info = "New password OK";	
		}
	}
	else{
		$_SESSION['error']="Different password";
	}
}

?>
<div id="page_file">
<?php if (isset($info)){?>
	<p class="title"><?php print $info; ?></p>
<?php }else{?>
<form action="index.php?page=user" method="post">
<table>
<caption>User settings</caption>
<tr>
	<td colspan="2" class="title">Modification du password</td>
</tr>
<tr>
	<td>Old password</td>
	<td><input type="password" name="old_passwd" /></td>
</tr>
<tr>
	<td>New password</td>
	<td><input type="password" name="new_passwd1" /></td>
</tr>
<tr>
	<td>ReNew password</td>
	<td><input type="password" name="new_passwd2" /></td>
</tr>
<tr>
	<td colspan="2"><input type="submit" value="change" /></td>
</tr>

</table>
</form>
<?php } ?>
</div>
<?php } ?>